<!doctype html>
<#import "/spring.ftl" as spring />
<html lang="en">
<head>
<#include "../include/css.ftl">
    <link href="${ctx}/static/plugins/jstree/style.css" rel="stylesheet" type="text/css"/>

</head>

<body class="adminbody">

<div class="content-page">
    <!-- Start content -->
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-xl-12">
                    <div class="breadcrumb-holder">
                        <h1 class="main-title float-left">Blank Page</h1>
                        <ol class="breadcrumb float-right">
                            <li class="breadcrumb-item">Home</li>
                            <li class="breadcrumb-item active">Blank Page</li>
                        </ol>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-xl-12">
                    <div class="card mb-3">

                        <div class="card-body">
                            <div id="authTree">
                            </div>

                            <button class="btn btn-primary" onclick="listTreeNode()"> Save </button>
                        </div>
                    </div><!-- end card-->
                </div>
            </div>
        </div>
        <!-- END container-fluid -->
    </div>
    <!-- END content -->
</div>
<!-- END content-page -->

<!-- END main -->
<#include "../include/js.ftl">
<script src="${ctx}/static/plugins/jstree/jstree.min.js"></script>

<script>
    $(document).ready(function () {
        var _csrf_token = $("meta[name='_csrf']").attr("content");
        var _csrf_header_name = $("meta[name='_csrf_header']").attr("content");
        $('#authTree').jstree({
            'core': {
                'themes': {
                    'responsive': false
                },
                'data': ${data}
            },
            'types': {
                'default': {
                    'icon': 'fa fa-folder-open'
                },
                'file': {
                    'icon': 'fa fa-file'
                }
            },
            "checkbox": {
                "keep_selected_style": false
            },
            'plugins': ["checkbox", 'types']

        }).on('changed.jstree', function (e, data) {
            console.log(data);
        }) ;
    });


</script>
<!-- END Java Script for this page -->

</body>
</html>